package com.kgc.scd.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * Created On : 2022/11/16 0016.
 * <p>
 * Author : shiguangchuan
 * <p>
 * Description: ShopCart
 */
@Data
@ApiModel(value = "购物车VO",description = "视图层领域模型数据对象，用于前端显示")
public class ShopCartVO implements Serializable {

    private static final long SERIAL_VERSION_UID = -4680948320252253717L;

    // 购物车id主键
    @ApiModelProperty(value = "购物车id")
    private String id;

    // 用户id
    @ApiModelProperty(value = "用户id")
    private String userId;

    // 商品id
    @ApiModelProperty(value = "商品id")
    private String goodsId;

    // 商品单价
    @ApiModelProperty(value = "商品单价")
    private Double retailPrice;

    // 计算商品当前总价
    @ApiModelProperty(value = "当前商品总价")
    private Double sumPrice;

    // 数量
    @ApiModelProperty(value = "选择的数量")
    private Integer cartNumber;

    // 购物车商品的状态
    @ApiModelProperty(value = "0:未勾选，1：已勾选")
    private Integer cartStatus;

    // 添加时间
    @ApiModelProperty(value = "添加的时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date creationTime;

    // 商品详情
    @ApiModelProperty(value = "商品详情")
    private ShopGoodsVO shopGoodsVO;

   /* @Override
    @JsonValue
    public String toString() {
        return "ShopCartVO{" +
                "id='" + id + '\'' +
                ", userId='" + userId + '\'' +
                ", goodsId='" + goodsId + '\'' +
                ", retailPrice=" + retailPrice +
                ", sumPrice=" + sumPrice +
                ", cartNumber=" + cartNumber +
                ", cartStatus='" + cartStatus + '\'' +
                ", creationTime=" + creationTime +
                '}';
    }*/
}
